package com.un.ebs.finance.dto;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

/**
 * @author liubo
 * @email liubocs@163.com
 * @date 2020/9/7 20:12
 */
@Data
public class FDetailDto {

    /**
     * 供应商
     */
    @JSONField(name = "FDETAILID__FFLEX4")
    private FNumberDto supplierCode;

    /**
     * 部门
     */
    @JSONField(name = "FDETAILID__FFLEX5")
    private FNumberDto deptCode;

    /**
     * 客户
     */
    @JSONField(name = "FDETAILID__FFLEX6")
    private FNumberDto customerCode;

    /**
     * 合同号
     */
    @JSONField(name = "FDETAILID__FFLEX7")
    private FNumberDto contractCode;

    public static FDetailDto valueSupplier(String code) {
        FDetailDto obj = new FDetailDto();
        obj.setSupplierCode(FNumberDto.value(code));
        return obj;
    }


    public static FDetailDto valueDept(String code) {
        FDetailDto obj = new FDetailDto();
        obj.setDeptCode(FNumberDto.value(code));
        return obj;
    }


    public static FDetailDto valueCustomer(String code) {
        FDetailDto obj = new FDetailDto();
        obj.setCustomerCode(FNumberDto.value(code));
        return obj;
    }

    public static FDetailDto valueDeptAndCustomer(String deptCode, String customerCode) {
        FDetailDto obj = new FDetailDto();
        obj.setDeptCode(FNumberDto.value(deptCode));
        obj.setCustomerCode(FNumberDto.value(customerCode));
        return obj;
    }

    public static FDetailDto valueDeptAndCustomer(String deptCode, String customerCode, String contractCode) {
        FDetailDto obj = new FDetailDto();
        obj.setDeptCode(FNumberDto.value(deptCode));
        obj.setCustomerCode(FNumberDto.value(customerCode));
        obj.setContractCode(FNumberDto.value(contractCode));
        return obj;
    }
}
